package net.csdn.business.common.oauth2.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.csdn.business.common.oauth2.model.entity.OauthAuthPermission;
import net.csdn.business.common.domain.request.oauth.OauthAuthPermissionQuery;
import net.csdn.business.common.domain.vo.oauth.OauthAuthPermissionVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * oauth权限Mapper接口
 * 
 * @author zhangyl
 * @date 2022-11-21
 */
@Repository
public interface OauthAuthPermissionMapper extends BaseMapper<OauthAuthPermission>
{

    /**
     * 分页查询oauth权限列表
     *
     * @param query 字典类型信息
     * @return 字典类型集合信息
     */
    public List<OauthAuthPermissionVO> findPageList(Page page, @Param("query") OauthAuthPermissionQuery query);


    /**
     * 查询oauth权限列表
     * 
     * @param query oauth权限
     * @return oauth权限集合
     */
    public List<OauthAuthPermissionVO> selectOauthAuthPermissionList(@Param("query") OauthAuthPermissionQuery query);


    @Select("<script> select req_url,req_method,auth_role from oauth_auth_permission " +
            "where req_method= #{query.reqMethod}" +
            "</script>")
    public List<OauthAuthPermissionVO> selectOauthRoleList(@Param("query")OauthAuthPermissionQuery query);

}
